package org.example.shoppingsystem.service;

import org.example.shoppingsystem.dao.UserDao;
import org.example.shoppingsystem.dao.UserDaoImpl;
import org.example.shoppingsystem.model.User;

import java.sql.SQLException;

public class UserServiceImpl implements UserService {
    private UserDao userDao = new UserDaoImpl();

    @Override
    public boolean login(String username, String password) throws SQLException {
        User user = userDao.findUserByUsername(username);
        if (user != null) {
            return user.getPassword().equals(password);
        }
        return false;
    }
}